import Vue from 'vue'
import Router from 'vue-router'

import selectCity from 'components/address/setCity/select-city'
import chooseAddress from 'components/address/choose-address'
import setAddress from 'components/address/set-address'

import nearRestaurants from 'components/restaurants/near-restaurants'
import search from 'components/search/search'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/nearRestaurants',
      fullPath:true
    },
    {
      path: '/address',
      component: chooseAddress,
      children:[
        {
          path: '/',
          name: 'address',
          component: setAddress
        },
        {
          path: 'selectCity',
          component: selectCity
        }
      ]
    },
    {
      path: '/nearRestaurants',
      name: 'nearRestaurants',
      component: nearRestaurants
    },
    {
      path: '/search',
      name: 'search',
      component: search
    }
  ]
})
